#!/usr/bin/env python
# encoding:utf-8
# @time   : 2019/10/14
# @author : 胡茂海
# @site   :
# @file   : settings.py

import pathlib as p
import os

# es 相关配置
es_host = '127.0.0.1'

# es config路径
es_config_path = "C:/software/elasticsearch-7.5.1/config/"
# es_config_path = "D:/elasticsearch-7.6.1/config/"

# excel表路径
excel_path = os.path.join(p.Path(__file__).parent.parent.parent, 'etc', 'nodes_relation.xlsx')

# 表列对应关系及列信息sheet
table_cols_sheet = 'nodes'
# es列对应表sheet
es_cols_map_sheet = 'import2es'

es_setting_sheet = 'es_settings'

es_stopword_sheet = 'stopwords'
es_synonym_sheet = 'synonyms'

# 文件分割后单文件行数
sep_every = 200000
# es bulk单次提交数量 不能大于 sep_every
update_every = 10000

# 节点表信息
nodedict = {
    'partnercontract'       : 't0202_kgem_partnercontract',
    'partnerproject'        : 't0202_kgem_partnerproject',
    'corporateloanarra'     : 't0202_kgem_corporateloanarra',
    'corporateloanacct'     : 't0202_kgem_corporateloanacct',
    'corporateguaranty'     : 't0202_kgem_corporateguaranty',
    'corporatedepositacct'  : 't0202_kgem_corporatedepositacct',
    'house'                 : 't0202_kgem_house',
    'building'              : 't0202_kgem_building',
    'buildingproject'       : 't0202_kgem_buildingproject',
    'enterprise'            : 't0202_kgem_enterprise',
    'credit'                : 't0202_kgem_credit',
    'person'                : 't0202_kgem_person',
    'personaldepositacct'   : 't0202_kgem_personaldepositacct',
    'personalloanacct'      : 't0202_kgem_personalloanacct',
    'personalloancollateral': 't0202_kgem_personalloancollateral',
    'loanadue'              : 't0202_kgem_loanadue',
    'enterprisegroup'       : 't0202_kgem_enterprisegroup',
}

if __name__ == '__main__':
    print(excel_path)
